#include<bits/stdc++.h>
using namespace std;
int n, m, ans, r[100001], a[100001];
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&r[i]);
	sort(r+1,r+1+n);
	for(int i=1;i<=n;i++)
	{
		if(r[i]>r[i-1])
			m++;
		a[m]++;
	}
	for(int i=2;i<=m;i++)
	{
		if(a[i]>=a[i-1])
			ans+=a[i-1];
		else
		{
			ans+=a[i];
			a[i]=a[i-1];
		}
	}
	printf("%d",n-ans);
	return 0;
}